<template>
  <div class="home">
    <!-- header start-->
    <div class="header">
      <span class="title">重庆信驰科技有限公司</span>
      <div class="tab">
        <el-link>首页</el-link>
        <el-link>全职招聘</el-link>
        <el-link>房屋租赁</el-link>
        <el-link>生活服务</el-link>
        <el-link>物品交易</el-link>
      </div>
      <div>
        <el-button type="primary">发布消息</el-button>
        <el-button type="info">注册</el-button>
        <el-button type="danger">登录</el-button>
      </div>
    </div>
    <!-- header end-->
    <!-- content start -->
    <!-- <router-view></router-view> -->
    <xc-content :title="title" :list="data"></xc-content>
    <!-- content end -->
    <!-- footer start -->
    <div class="footer">
      <el-link @click="gotoGov"
        >copyright (c) 1995-2009 CQXC.allright
        reserved.ICP备案号：渝ICP备09054615号-1</el-link
      >
    </div>
    <!-- footer end -->
    <!-- publish dialog start -->
    <el-dialog
      title="发布消息"
      :visible.sync="publishDialogVisible"
      width="30%"
    >
      <el-form
        :model="ruleForm"
        :rules="rules"
        ref="ruleForm"
        label-width="100px"
        class="demo-ruleForm"
      >

        <el-form-item label="发布类型" prop="region">
          <el-select v-model="ruleForm.type" placeholder="请选择发布类型">
            <el-option label="全职招聘" value="1"></el-option>
            <el-option label="房屋租赁" value="2"></el-option>
            <el-option label="生活服务" value="3"></el-option>
            <el-option label="物品交易" value="4"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="发布标题" prop="name">
            <el-input v-model="ruleForm.title"></el-input>
        </el-form-item>
        <el-form-item label="发布人" prop="name">
            <el-input v-model="ruleForm.people"></el-input>
        </el-form-item>
        <el-form-item label="活动时间" required>
          <el-col :span="11">
            <el-form-item prop="date1">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                v-model="ruleForm.date1"
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col class="line" :span="2">-</el-col>
          <el-col :span="11">
            <el-form-item prop="date2">
              <el-time-picker
                placeholder="选择时间"
                v-model="ruleForm.date2"
                style="width: 100%"
              ></el-time-picker>
            </el-form-item>
          </el-col>
        </el-form-item>
        <el-form-item label="即时配送" prop="delivery">
          <el-switch v-model="ruleForm.delivery"></el-switch>
        </el-form-item>
        <el-form-item label="活动性质" prop="type">
          <el-checkbox-group v-model="ruleForm.type">
            <el-checkbox label="美食/餐厅线上活动" name="type"></el-checkbox>
            <el-checkbox label="地推活动" name="type"></el-checkbox>
            <el-checkbox label="线下主题活动" name="type"></el-checkbox>
            <el-checkbox label="单纯品牌曝光" name="type"></el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="特殊资源" prop="resource">
          <el-radio-group v-model="ruleForm.resource">
            <el-radio label="线上品牌商赞助"></el-radio>
            <el-radio label="线下场地免费"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="活动形式" prop="desc">
          <el-input type="textarea" v-model="ruleForm.desc"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm('ruleForm')"
            >立即创建</el-button
          >
          <el-button @click="resetForm('ruleForm')">重置</el-button>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="publishDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="publishDialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
    <!-- publish dialog start -->
  </div>
</template>

<script>
// @ is an alias to /src
import XcContent from "../components/XcContent";
import data from "./data.json";
export default {
  name: "Home",
  components: {
    XcContent,
  },
  data() {
    return {
      title: "全职招聘",
      data: [],
      publishDialogVisible: true,
    };
  },
  created() {
    this.data = data.zhaopinList;
  },
  methods: {
    gotoGov() {
      window.open("https://beian.miit.gov.cn", "_blank");
    },
  },
};
</script>
<style lang="scss">
.header {
  display: flex;
  justify-content: space-between;
  height: 50px;
  align-items: center;
  background-color: #f6f6f6;
  padding: 0 20px;
  .title {
    font-size: 24px;
    font-weight: bold;
  }
  .tab {
    a {
      margin-right: 20px;
      font-size: 16px;
    }
  }
}
.footer {
  display: flex;
  justify-content: center;
  height: 50px;
  align-items: center;
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #f6f6f6;
}
.content {
  padding: 50px 50px;
  .title {
    height: 40px;
    line-height: 40px;
    padding-left: 10px;
    background-color: #409eff;
    color: #f6f6f6;
  }
  .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    height: 50px;
    border-bottom: 1px dashed #ddd;
  }
  .pagination {
    margin-top: 20px;
    text-align: center;
  }
}
</style>
